package cn.tedu.product.controller;

import cn.tedu.product.service.IndexService;
import com.jt.common.vo.SysResult;
import org.apache.lucene.search.IndexSearcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {
    @Autowired
    private IndexService indexService;
    @RequestMapping("index/create")
    public SysResult createIndex(){
        //indexName easymall type product
        try {
            indexService.createIndex();
            return SysResult.ok();
        }catch (Exception e){
            e.printStackTrace();
            return SysResult.build(201,"创建失败",null);
        }
    }

}
